<script setup lang="ts">
import { ref } from 'vue'

defineProps<{ msg: string }>()

//data:
// ref: 响应式数据, 在 script 中只能使用.value访问，在 template 中直接使用
const count = ref(0)
const age = ref(18)

//methods:
function addCount(){
    count.value++;
    let t = age.value;
}
</script>

<template>
  <h1>{{ msg }}</h1>
    {{age}}

  <div class="card">
    <button type="button" @click="count++">count is {{ count }}</button>
      <button type="button" @click="addCount">count : {{ count }}</button>
    <p>
      <code>components/HelloWorld.vue</code> to test HMR
    </p>
  </div>
</template>

<style scoped>
.read-the-docs {
  color: #888;
}
</style>
